let map = {}
function fact (n, base = 1) {
  if (n < 2) {
    return 1 * base;
  } else {
    return fact(n - 1, n * base);
  }
}
console.log(fact(5));